<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
    <title>注册-个人用户</title>
    <link type="text/css" rel="stylesheet" href="../css/register/regist.personal.css"/>
    <link type="text/css" rel="stylesheet" href="../css/register/passport.base.css"/>
    <script type="text/javascript" src="../js/register/jquery-1.2.6.min.js"></script>
</head>
<body>
    <script type="text/javascript">
function login() {
    location.href = "/user/login.html";
    return false
}
function regist() {
    location.href = "/user/register.html";
    return false
}
(function (a) {
    a.fn.Jdropdown = function (d, e) {
        if (!this.length) {
            return
        }
        if (typeof d == "function") {
            e = d;
            d = {}
        }
        var c = a.extend({event: "mouseover", current: "hover", delay: 0}, d || {});
        var b = (c.event == "mouseover") ? "mouseout" : "mouseleave";
        a.each(this, function () {
            var h = null, g = null, f = false;
            a(this).bind(c.event,
                    function () {
                        if (f) {
                            clearTimeout(g)
                        } else {
                            var j = a(this);
                            h = setTimeout(function () {
                                j.addClass(c.current);
                                f = true;
                                if (e) {
                                    e(j)
                                }
                            }, c.delay)
                        }
                    }).bind(b, function () {
                        if (f) {
                            var j = a(this);
                            g = setTimeout(function () {
                                j.removeClass(c.current);
                                f = false
                            }, c.delay)
                        } else {
                            clearTimeout(h)
                        }
                    })
        })
    }
})(jQuery);
function addToFavorite() {
    var a = "index";
    var b = "闲渔商城-淘二手，上京淘，省钱又放心";
    if (document.all) {
        window.external.AddFavorite(a, b)
    } else if (window.sidebar) {
        window.sidebar.addPanel(b, a, "")
    } else {
        alert("对不起，您的浏览器不支持此操作!\n请您使用菜单栏或Ctrl+D收藏本站。")
    }
}</script>
<!--shortcut start-->
<jsp:include page="index" />
<!--shortcut end-->
<!-- <div class="w" id="logo">
    <div>
        <a href="index">
            <img src="../images/register/xianyulogin.png" alt="闲渔商城" width="170" height="100"/>
        </a> <b></b>
    </div>
</div>
 -->
<div class="w" id="regist">
    <div class="mt">
        <ul class="tab">
            <li class="curr">个人用户</li>
            <li class="line hide"><a clstag="regist|keycount|personalreg|02" href="../reg/company">企业用户</a></li>
            <li class="fore hide"><a href="http://passport.en.jd.com/user/facade">International Customers</a></li>
        </ul>
        <div class="extra">
        <span style="text-align: right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="flk13"
                                                                               onclick="javascript:location.href=&quot;http://en.360buy.com&quot;+location.search;"
                                                                               href="index">首页</a></span> <span>我已经注册，现在就&nbsp;<a
                href="login"
                class="flk13">登录</a></span>
        </div>
    </div>
    <div class="mc">
        <form id="personRegForm" method="POST" onsubmit="return false;">
            <input type="hidden" name="regType" id="regType" value="person"/>
            <input type="hidden" name="uuid" id="uuid" value="${uuid}"/>
            <input type="hidden" name="verifymc" id="verifymc" value=""/>
            <input type="hidden" name="emailMg" id="emailMg"/>
            <input type="hidden" name="authcodeMg" id="authcodeMg"/>
            <input type="hidden" name="state" id="state" value=""/>

            <div class="form" onselectstart="return false;">
                <div class="item" id="select-username">
                    <span class="label"><b class="ftx04">*</b>用户名：</span>

                    <div class="fl item-ifo">
                        <div class="o-intelligent-username">
                            <input type="text" id="username" name="username" class="text" tabindex="1" autoComplete="off"
                                   onpaste="return false;"
                                   value=""
                                   onfocus="if(this.value=='') this.value='';this.style.color='#333'"
                                   onblur="if(this.value=='') {this.value='';this.style.color='#999999'}"/>
                            <i class="i-name"></i>
                            <ul id="intelligent-username" class="hide"></ul>
                            <label id="username_succeed" class="blank"></label>
                            <label id="username_error" class="hide"></label>
                        </div>

                        <div class="intelligent-error hide" id="morePinDiv">
                            <h5>推荐您使用：</h5>

                            <div class="groom" id="morePinGroom"></div>
                        </div>
                                                <input type="hidden" value="-1" id="hnschool" class="hide"/>
                                                <input type="hidden" id="schoolid" name="schoolid" class="hide"/>
                                                    <input type="hidden" name="eBHtwyeixI" value="EyEFt"/>
                                                <input type="hidden" id="hnseli" class="hide"/>

                    </div>
                </div>

                <div id="capslock"><i></i><s></s>键盘大写锁定已打开，请注意大小写</div>
                <div id="o-password">
                    <div class="item">
                        <span class="label"><b class="ftx04">*</b>请设置密码：</span>

                        <div class="fl item-ifo">
                            <input type="password" id="pwd" name="password" class="text" tabindex="2"
                                   style="ime-mode:disabled;"
                                   onpaste="return  false" autocomplete="off"/>
                            <i class="i-pass"></i>
                            <label id="pwd_succeed" class="blank"></label>
                            <label id="pwd_error"></label>
                            <span class="clr"></span>
                            <label class="hide" id="pwdstrength"><span class="fl">安全程度：</span><b></b></label>

                        </div>
                    </div>
                    <script type="text/javascript">
                        $('#pwd')[0].onkeypress = function (event) {
                            var e = event || window.event,
                                $tip =
                            $('#capslock'),
                                    kc = e.keyCode || e.which, // 按键的keyCode
                                    isShift = e.shiftKey || (kc == 16 ) || false; // shift键是否按住
                            if (((kc >= 65 && kc <= 90) && !isShift) || ((kc >= 97 && kc <= 122) && isShift)) {
                                    $tip.show();
                            }
                            else {
                                    $tip.hide();
                            }
                        };
                    </script>

                    <div class="item">
                        <span class="label"><b class="ftx04">*</b>请确认密码：</span>

                        <div class="fl item-ifo">
                            <input type="password" id="pwdRepeat" name="pwdRepeat" class="text" tabindex="3"
                                   onpaste="return  false" autocomplete="off"/>
                            <i class="i-pass"></i>
                            <label id="pwdRepeat_succeed" class="blank"></label>
                            <label id="pwdRepeat_error"></label>
                        </div>
                    </div>
						<div class="item">
                        <span class="label"><b class="ftx04">*</b>邮箱验证：</span>

                        <div class="fl item-ifo">
                            <input type="text" id="email" name="email" class="text"  onpaste="return  false" autocomplete="off">
                            <i class="i-email"></i>
                            <label id="email_succeed" class="blank"></label>
                            <label id="email_error"></label>
                        </div>
                                                 <div class="fl">
                            <span class="ftx-03 ml5">或</span><a class="ftx-05 ml5 mail-verify"
                                                                style="text-decoration:underline;" href="register">手机验证</a>
                        </div>
                       </div>
						<div class="item" style="height: 62px;">
                        <span class="label"><b class="ftx04">*</b>邮箱验证码：</span>

                        <div class="fl item-ifo">
                            <input type="text" maxlength="6" autocomplete="off" tabindex="6" class="text text-1"
                                   name="code"
                                   style="ime-mode:disabled" id="mobileCode" onblur="mobileCodeBlur()"
                                   onfocus="mobileCodeFocus();">
                            <label class="blank invisible"></label>
                            <a class="btn" href="javascript:void(0);" onclick="sendMobileCode();" id="sendMobileCode">
                                <span id="dyMobileButton">获取邮箱验证码</span></a>
                            <span class="clr"></span>

                            <div class="msg-text" id="mobileCodeSucMessage"></div>
                            <label id="mobileCode_error" class="blank"></label>
                            <label id="mobileCode_succeed" class="blank invisible"></label>
                        </div>
                        <span class="clr"></span>
                    </div>
                                    </div>
                                <div class="item item-new">
                    <span class="label">&nbsp;</span>
                    
                    <div class="fl item-ifo">
                        <input type="checkbox" class="checkbox" checked="checked" id="readme"
                               onclick="agreeonProtocol();">
                        <label for="protocol">我已阅读并同意<a href="#" class="blue" id="protocol">《闲渔用户注册协议》</a></label>
                        <span class="clr"></span>
                        <label id="protocol_error" class="error hide">请接受服务条款</label>
                    </div>
                </div>
                <div class="item">
                    <span class="label">&nbsp;</span>
                    <input type="button" class="btn-img btn-regist" id="registsubmit" value="立即注册" tabindex="8"
                           clstag="regist|keycount|personalreg|07"
                           onclick="reg();"/>
                </div>
            </div>
            <div class="phone">
                <img width="280" height="280" src="../images/register/xianyulogin.png">
            </div>
                        <span class="clr"></span>
        </form>
    </div>
</div>
<div id="footer">
		<div class="tmall-copyright">
			<div class="cr-container">
				<p class="footer-tmallinfo">
					<a href="#">关于闲渔</a> <a href="#">帮助中心</a> <a href="#">开放平台</a> <a
						href="#">诚聘英才</a> <a href="#">联系我们</a> <a href="#">网站合作</a> <a
						href="#">法律声明</a> <a href="#">知识产权</a> <a href="#">廉正举报</a> <a
						href="#">规则意见征集</a>
				</p>
				<p class="footer-otherlinks">
					<a href="#">闲渔集团</a> <a href="#">闲渔网</a> <a href="#">闲渔</a> <a
						href="#">1688</a> <a href="#">闲渔计算</a> <a href="#">闲渔通信</a>
				</p>
				<div class="footer-copyright">
					<span>增值电信业务经营许可证：<a href="#">浙B2-201104461</a></span> <span>网络文化经营许可证：<a
						href="#">浙网文[2015]0295-065号</a></span> <span>互联网医疗保健信息服务 审核同意书
						浙卫网审【2014】6号</span><br> <span>互联网药品信息服务资质证书编号：浙-（经营性）-2012-0005</span>
					<b>@2003-2016TMALL.COM版权所有</b>
				</div>
			</div>
		</div>
		</div>
<script type="text/javascript">
$("#sendMobileCode").click(function (){
    sendyzm($("#sendMobileCode"));
});
//用ajax提交到后台的发送短信接口
function sendyzm(obj){
    var mail = $("#email").val();
    var result = isPhoneNum();
    if(result) {
        $.ajax({
            url:"user/getMailCode",
            data:{mail:mail},
            dataType:"json",
            type:"post",
            async : false,
            cache : false,
            success:function(res){
                if(res){
                    alert(res.message);
                }else{

                }
            },
            error:function(){
                alert("验证码发送失败");
            }
        })
        setTime(obj);//开始倒计时
    }
}

//60s倒计时实现逻辑
var countdown = 60;
function setTime(obj) {
	var obj = $("#dyMobileButton").val();
    if (countdown == 0) {
    	/* $("#dyMobileButton").prop('disabled', false); */
    	$("#dyMobileButton").html("获取邮箱验证码");
        countdown = 60;//60秒过后button上的文字初始化,计时器初始化;
        return;
    } else {
    	//obj.html("("+countdown+"s)后重新发送");
        $("#dyMobileButton").html("("+countdown+"s)后重新发送") ;
        countdown--;
    }
    setTimeout(function() { setTime(obj) },1000) //每1000毫秒执行一次
}


//校验邮箱是否合法
function isPhoneNum(){
    var phonenum = $("#email").val();
    var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
    if(!reg.test(phonenum)){
        alert('请输入有效的邮箱格式！');
        return false;
    }else{
        return true;
    }
} 
	$("#registsubmit").click(function(){
	    $.ajax({
	        type:"post",
	        url:"user/addUser",
	        async : true,
	        data:$('#personRegForm').serializeArray(),
	        dataType:"json",

	        success:function (result) { 
	                alert(result.message);
	                if(result.message=="创建成功"){
	                location.href="login";
	                }
	            }
	    })
	});
</script>
<script type="text/javascript" src="../js/register/jd.lib.js"></script>
<script type="text/javascript" src="../js/register/jdThickBox.js"></script>
<script type="text/javascript" src="../js/register/jdValidate.js"></script>
<script type="text/javascript" src="../js/register/jdValidate.emReg.js"></script>
<script type="text/javascript" src="../js/register/jdValidate.regSuccess.js"></script>


</body>
</html>
